#include "ResourceEntry.h"

using namespace std;

//======================================================
// Resource class methods
//======================================================

LPCTSTR ResourceEntry::getRandomImage()
{
	if (m_imagesPath.size() == 0) return _T("");
	srand( (unsigned)time( NULL ) );
	return m_imagesPath[rand() % m_imagesPath.size()];
}

LPCTSTR ResourceEntry::getRandomSound()
{
	if (m_soundsPath.size() == 0) return _T("");
	srand( (unsigned)time( NULL ) );
	return m_soundsPath[rand() % m_soundsPath.size()];
}

LPCTSTR ResourceEntry::getRandomVideo()
{
	if (m_videosPath.size() == 0) return _T("");
	srand( (unsigned)time( NULL ) );
	return m_videosPath[rand() % m_videosPath.size()];
}

bool ResourceEntry::isSoundNotAvailable()
{
	return (m_soundsPath.size() == 0);
}

void ResourceEntry::clear()
{
	m_imagesPath.clear();
	m_soundsPath.clear();
	m_videosPath.clear();
}